Android Implementation MP3 playerBefore the exam, this well-done project has not had time to summarize. Although in the period of doing the project, the use of the various techniques are recorded as a blog, but there should be a general summary and summing up.This is the first large-scale project of its kind, which is the project that the Mars big video last introduced in the first quarter. But I insist on
Learning to develop Android for a year, think about this year's efforts, and indeed harvest a lot. Also found a better job. Today you are ready to share a project that was previously practiced in the beginner stage. Through this project I really found the development of the feeling of Android software, and gradually entered the formal development of Android. This
add some beautiful girls to the background, just add background to the layout file. Here we will focus on logic, if you don't talk about these fancy things, how can you switch from the first activity to the second activity? We need to use our powerful Intent. Intent can implement the conversion of one activity to another. When you click a song, the playing interface needs to know that you are playing the magic horse. A series of Song information needs to be passed to the second interface. This
function, just add a line of code to complete. Private void Play(intCurrentTime) {Try{Mediaplayer.reset ();//Restore the parameters to their original stateMediaplayer.setdatasource (path); Mediaplayer.prepare ();//BufferingMediaplayer.setonpreparedlistener (NewPreparedlistener (currenttime));//Register a listenerINITLRC ();//Update playback statusIntent Intent =NewIntent (Play_statue);//Send the completed signal, update the playback statusIntent.putextra ("Playstatue",true); Sendbroa
Scan local file to load to itemNot limited to apps to music player, other Android works, can also use SdcardsearchtolistOther Android projects can also be used, I have now done a very small demoLater will post, will be in the player, add this function, to achieve just downloaded music, loaded into the playerThis demo s
that was obtained before the activity was bound to the service. whenever the activitybinder.transact (0, data, reply, 0); When invoked, the service invokes the Ontransact method, loads the obtained data into the parcel object reply, and then the entire The IBinder object returns activity. MP3 player This is finished, may be very messy, I hope to help you, source code download Link: http://download.csdn.n
Playing MP3 in Android is very simple and often used in projects, such as background music for projects and prompts for certain functions in applications. It is widely used. Here is a simple example:
Layout file Configuration:
Java implementation file:
/*****/Package COM. demo. media; import
reply,
Int flags) throws RemoteException {
String str = data.readString();
Int currentPosition = mediaPlayer.getCurrentPosition();
Float s = (float)currentPosition/mediaPlayer.getDuration();
If(isPlay)
reply.writeFloat(s);
Return super.onTransact(code, data, reply, flags);
}
Yes, I do. It is the IBinder object that was obtained prior to the activity and service binding. whenever the activitybinder.transact (0, data, reply, 0); The service calls the Ontransact method. Load the acquired
Android Development-mediaplayer Simple music playerFunction Introduction
Implement a simple player, similar to the NetEase cloud music format, features include:
Play, pause, stop, exit function;
Background playback function;
Progress bar shows playback progress, drag progress bar change
Use MediaPlayer to do simple music player, more content please go to Baidu experience view http://jingyan.baidu.com/article/60ccbceb63452364cab197f1.html"http://schemas.android.com/apk/res/android"Xmlns:tools="Http://schemas.android.com/tools"Android:layout_width="match_parent"Android:layout_height="match_parent"android:paddingleft="@dimen/activity_horizontal_mar
Android Learning Organization _ Service simple application. Music player
1. Because we need to use Service, we need to define it in the AndroidManifest. xml file.
2. Then, put the music to be played in the res/raw folder.3.// Music. java FilePackage com. edgar. playservice;
Import com. edgar. playservice. R;Import com. edgar. playservice. R. raw;
Import
After the basic Android training is complete, you can create a simple music player. For the first small Android project, baseline the picture ~~~~
The UI is inspired by the fact that thunder looks at the player and plays the mediaplayer class when audio is used in
discard the initial PS results .. Convert it to a vertical one .. The figure is as follows:
Before conversion:
After conversion:
Pretty good ~ At that time, I wanted to turn the horizontal chart into a vertical chart and thought of various methods .. Search on the Internet .. Fortunately, the background color is relatively simple .. After I cut a bit of the above cloud replication, the integration is particularly poor .. I am not satisfied with t
In the previous section, the embedded flash animation in the android program is roughly described. This time I made an extension based on the previous content and made a simple Flash Player.
The prerequisites are described in the previous section. You need to install the Android platform and the flash plug-in.
First l
Android app-simple and beautiful music players add phone monitors
In September 2nd, the simplified and beautiful music players started Stage 1
Stage 1 has completed the following functions:
1. automatically display the music list
2. Click the list to play the music.
3. Long press List dialog box
4. Pause music
5. Last music
6. Next music
7. automatically play the next song
8. Single Loo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.